package com.newtouch.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.newtouch.common.Page;
import com.newtouch.model.Department;
import com.newtouch.service.DepartmentService;
import com.newtouch.dao.DepartmentDao;
import com.newtouch.service.base.impl.BaseServiceImpl;
@Service

public class DepartmentServiceImpl extends BaseServiceImpl implements
		DepartmentService {
	@Autowired
	private DepartmentDao departmentdao;

	public void addDepartment(Department department) {
		departmentdao.insertModelObject(department);
	}

	public Integer deleteDepartment(String id) {
		return departmentdao.deleteModelObject(new Long(id));
	}

	public Integer editDepartment(Department department) {
		return departmentdao.updateModelObject(department);
	}

	public Department findDepartmentById(String id) {
		return departmentdao.getModelObject(new Long(id));
	}

	public List<Department> findDepartments(Page page) {
		return departmentdao.selectModelObjectListPage(page);
	}
}